package tetris.features;

import java.util.ArrayList;

import tetris.simulator.State;

public class HolesFeature extends Feature{  
  public ArrayList<Double> getFeatureVector(State tetrisState) {
    ArrayList<Double> featureVector = new ArrayList<Double>();
    int numHoles = 0;
    for (int i = 0; i < tetrisState.getTop().length; i++) 
      for (int j = tetrisState.getTop()[i] - 1; j >= 0; j--) 
        if (tetrisState.getField()[j][i] == 0)
          numHoles ++;
    featureVector.add(new Double(numHoles));
    return featureVector;
  }

}
